<?php

namespace App\Console\Commands\Tools\Menus;

use App\Kuafu\Mqtt\Service\MqttQueueService;
use App\Kuafu\Pay\BasePay;
use App\Kuafu\Pay\Channel\FuYou\FuYouBase;
use App\Kuafu\Pay\Service\PayService;
use App\Kuafu\Product\Enum\ProductCacheEnum;
use App\Kuafu\Product\Model\Product;
use App\Kuafu\ProductMenu\Model\ProductMenu;
use App\Kuafu\Shop\Enum\ShopCacheEnum;
use App\Kuafu\Shop\Model\Shop;
use App\Kuafu\Shop\Service\ShopCameraSyncService;
use App\Kuafu\Shop\Service\ShopService;
use App\Kuafu\WaiMai\Enum\WaiMaiDBEnum;
use App\Kuafu\WaiMai\Model\WaiMaiShopMappingModel;
use App\Library\FeiShu\SendFs;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Log;

class RefreshAllShopMenusCacheCommand extends Command
{

    protected $signature = 'tools:refresh-all-shop-menus-cache';


    protected $description = '刷新门店菜单缓存';

    public function handle()
    {
        $list    = Shop::query()->select(['id'])->where('status', 0)->get();
        $shopIds = $list->pluck('id');
        foreach ($shopIds as $shopId) {
            Product::refreshGetMenuProductsPackageCustom($shopId);
        }
        MqttQueueService::updateProductMenu($shopIds->toArray());
    }
}
